-- Adds support for MonetaryValue in GarbageFu

-- lalalaaaaa
function SarfFix2_GarbageFu_GetMonetaryValuePrice(self, item)
	local value = MonetaryValue:GetItemPrice(item.link);
	if ( value ) then
		return value, "|cff0077ffVM|r";
	end
end

function SarfFix2:GarbageFu_Initialize()
	local addonName = "MonetaryValue";
	local addonGlobal = getglobal(addonName);
	if ( addonGlobal ) and ( type(addonGlobal.GetItemPrice) == "function" ) then
		local index = strlower(addonName);
		local v = GarbageFu.vars.vendoraddons[index];
		local funcName = "GetMonetaryValuePrice";
		if ( not v ) and ( type(GarbageFu[funcName]) ~= "function" ) then
			table.insert(GarbageFu.vars.vendoraddonsorder, index);
			GarbageFu.vars.vendoraddons[index] = {name=addonName, func=funcName, check=addonName};
			GarbageFu[funcName] = SarfFix2_GarbageFu_GetMonetaryValuePrice;
			GarbageFu:InitVendor()
		end
		
	end
end

SarfFix2:PatchAddon("FuBar_GarbageFu", SarfFix2.GarbageFu_Initialize);

 
